package com.blackcat.recode.controller;


import com.blackcat.recode.common.annotation.Log;
import com.blackcat.recode.common.result.AjaxResult;
import com.blackcat.recode.entity.Project;
import com.blackcat.recode.enums.BusinessType;
import com.blackcat.recode.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import com.blackcat.recode.service.DeployRecodeService;
import com.blackcat.recode.entity.DeployRecode;

/**
 * <p> 客户部署记录表 前端控制器
 * @author blackcat 2024-09-13
 */
@RestController
@RequestMapping("/deploy")
public class DeployRecodeController {

    @Autowired
    private DeployRecodeService deployRecodeService;

    @GetMapping("/getList")
    public AjaxResult getList(Integer page, Integer size, String customerId, String projectId, String serviceId) {
        return deployRecodeService.getList(page,size,customerId,projectId,serviceId);
    }

    @Log(title = "项目编辑", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody DeployRecode deployRecode) {
        return deployRecodeService.edit(deployRecode);
    }

    @GetMapping("/getOne")
    public AjaxResult getOne(String id) {
        return deployRecodeService.getOne(id);
    }

    @Log(title = "项目删除", businessType = BusinessType.DELETE)
    @DeleteMapping("/delete")
    public AjaxResult delete(String id) {
        deployRecodeService.removeById(id);
        return AjaxResult.success();
    }

}
